view,
scroll-view,
swiper,
button,
input,
textarea,
label,
navigator,
image {
  box-sizing: border-box;
}

button::after {
  border: none;
}

$direction: top, right, bottom, left;

/* 基本样式 start */

.zy-width-full {
  width: 100%;
}

.zy-height-full {
  height: 100%;
}

.zy-round {
  border-radius: 5000rpx !important;
}

.zy-radius {
  border-radius: 12rpx;
}

.zy-bg-white {
  background: #fff;
}

.zy-shadow {
  box-shadow: 0 0 20px 0 rgb(24 25 68 / 5%);
}

/* 基本样式 end */

/* flex start */

.zy-flex {
  display: flex;
}

/* flex伸缩基准值 */
.zy-flex-basic-xs {
  flex-basis: 20%;
}

.zy-flex-basic-sm {
  flex-basis: 40%;
}

.zy-flex-basic-md {
  flex-basis: 50%;
}

.zy-flex-basic-lg {
  flex-basis: 60%;
}

.zy-flex-basic-xl {
  flex-basis: 80%;
}

.zy-flex-basic-full {
  flex-basis: 100%;
}

/* flex布局的方向 */
.zy-flex-direction-column {
  flex-direction: column;
}

.zy-flex-direction-row {
  flex-direction: row;
}

.zy-flex-direction-column-reverse {
  flex-direction: column-reverse;
}

.zy-flex-direction-row-reverse {
  flex-direction: row-reverse;
}

/* flex容器设置换行 */
.zy-flex-wrap {
  flex-wrap: wrap;
}

.zy-flex-nowrap {
  flex-wrap: nowrap;
}

/* flex容器自身垂直方向对齐方式 */
.zy-flex-center {
  align-self: center;
}

.zy-flex-top {
  align-self: flex-start;
}

.zy-flex-end {
  align-self: flex-end;
}

.zy-flex-stretch {
  align-self: stretch;
}

/* flex子元素垂直方向对齐方式 */
.zy-flex-col-center {
  align-items: center;
}

.zy-flex-col-top {
  align-items: flex-start;
}

.zy-flex-col-bottom {
  align-items: flex-end;
}

/* flex子元素水平方向对齐方式 */
.zy-flex-row-center {
  justify-content: center;
}

.zy-flex-row-left {
  justify-content: flex-start;
}

.zy-flex-row-right {
  justify-content: flex-end;
}

.zy-flex-row-between {
  justify-content: space-between;
}

.zy-flex-row-around {
  justify-content: space-around;
}

/* flex子元素空间分配 */
@for $i from 0 to 12 {
  .zy-flex-#{$i} {
    flex: $i;
  }
}

.zy-col-12 {
  width: 100%;
}

.zy-col-11 {
  width: 91.66666667%;
}

.zy-col-10 {
  width: 83.33333333%;
}

.zy-col-9 {
  width: 75%;
}

.zy-col-8 {
  width: 66.66666667%;
}

.zy-col-7 {
  width: 58.33333333%;
}

.zy-col-6 {
  width: 50%;
}

.zy-col-5 {
  width: 41.66666667%;
}

.zy-col-4 {
  width: 33.33333333%;
}

.zy-col-3 {
  width: 25%;
}

.zy-col-2 {
  width: 16.66666667%;
}

.zy-col-1 {
  width: 8.33333333%;
}

/* flex end */

/* 内边距 start */

@for $i from 0 to length($direction) + 1 {
  @if $i == 0 {
    .zy-no-margin {
      margin: 0;
    }

    .zy-margin-xs {
      margin: 10rpx;
    }

    .zy-margin-sm {
      margin: 20rpx;
    }

    .zy-margin {
      margin: 30rpx;
    }

    .zy-margin-lg {
      margin: 40rpx;
    }

    .zy-margin-xl {
      margin: 50rpx;
    }
  }

  @else {
    .zy-no-margin-#{nth($direction, $i)} {
      margin-#{nth($direction, $i)}: 0;
    }
    .zy-margin-#{nth($direction, $i)}-xs {
      margin-#{nth($direction, $i)}: 10rpx;
    }
    .zy-margin-#{nth($direction, $i)}-sm {
      margin-#{nth($direction, $i)}: 20rpx;
    }
    .zy-margin-#{nth($direction, $i)} {
      margin-#{nth($direction, $i)}: 30rpx;
    }
    .zy-margin-#{nth($direction, $i)}-lg {
      margin-#{nth($direction, $i)}: 40rpx;
    }
    .zy-margin-#{nth($direction, $i)}-xl {
      margin-#{nth($direction, $i)}: 50rpx;
    }
  }
}

/* 内边距 end */

/* 外边距 start */

@for $i from 0 to length($direction) + 1 {
  @if $i == 0 {
    .zy-no-padding {
      padding: 0;
    }

    .zy-padding-xs {
      padding: 10rpx;
    }

    .zy-padding-sm {
      padding: 20rpx;
    }

    .zy-padding {
      padding: 30rpx;
    }

    .zy-padding-lg {
      padding: 40rpx;
    }

    .zy-padding-xl {
      padding: 50rpx;
    }
  }

  @else {
    .zy-no-padding-#{nth($direction, $i)} {
      padding-#{nth($direction, $i)}: 0;
    }
    .zy-padding-#{nth($direction, $i)}-xs {
      padding-#{nth($direction, $i)}: 10rpx;
    }
    .zy-padding-#{nth($direction, $i)}-sm {
      padding-#{nth($direction, $i)}: 20rpx;
    }
    .zy-padding-#{nth($direction, $i)} {
      padding-#{nth($direction, $i)}: 30rpx;
    }
    .zy-padding-#{nth($direction, $i)}-lg {
      padding-#{nth($direction, $i)}: 40rpx;
    }
    .zy-padding-#{nth($direction, $i)}-xl {
      padding-#{nth($direction, $i)}: 50rpx;
    }
  }
}

/* 外边距 end */

/* float start */

.zy-float-left {
  float: left;
}

.zy-float-right {
  float: right;
}

.zy-clear-float {
  clear: both;
}

.zy-clear-float::after,
.zy-clear-float::before {
  content: " ";
  display: table;
  clear: both;
}

/* float end */

/* 边框 start */

@for $i from 0 to length($direction) + 1 {
  @if $i == 0 {
    .zy-border-solid {
      border-width: 1rpx !important;
      border-style: solid;
      border-color: $zy-middle-color8;

      &.zy-bold-border {
        border-width: 6rpx !important;
      }
    }

    .zy-border-solids {
      border-width: 1rpx !important;
      border-style: solid;
      border-color: $zy-middle-color8;

      &.zy-bold-border {
        border-width: 6rpx !important;
      }
    }

    .zy-border-dashed {
      border-width: 1rpx !important;
      border-style: dashed;
      border-color: $zy-middle-color8;

      &.zy-bold-border {
        border-width: 6rpx !important;
      }
    }
  }

  @else {
    .zy-border-solid-#{nth($direction, $i)} {
      border: 0rpx;
      border-#{nth($direction, $i)}-width: 1rpx !important;
      border-style: solid;
      border-color: $zy-middle-color8;

      &.zy-bold-border {
        border-#{nth($direction, $i)}-width: 6rpx !important;
      }
    }
    .zy-border-solids-#{nth($direction, $i)} {
      border: 0rpx;
      border-#{nth($direction, $i)}-width: 1rpx !important;
      border-style: solid;
      border-color: $zy-middle-color8;

      &.zy-bold-border {
        border-#{nth($direction, $i)}-width: 6rpx !important;
      }
    }
    .zy-border-dashed-#{nth($direction, $i)} {
      border: 0rpx;
      border-#{nth($direction, $i)}-width: 1rpx !important;
      border-style: dashed;
      border-color: $zy-middle-color8;

      &.zy-bold-border {
        border-#{nth($direction, $i)}-width: 6rpx !important;
      }
    }
  }
}

/* 边框 end */

/* 文本 start */

.zy-text-xs {
  font-size: 20rpx;
}

.zy-text-sm {
  font-size: 24rpx;
}

.zy-text-md {
  font-size: 28rpx;
}

.zy-text-lg {
  font-size: 32rpx;
}

.zy-text-xl {
  font-size: 36rpx;
}

.zy-text-xxl {
  font-size: 40rpx;
}

.zy-text-xl-xxl {
  font-size: 80rpx;
}

.zy-text-xxl-xxl {
  font-size: 120rpx;
}

.zy-text-upper {
  text-transform: uppercase;
}

.zy-text-cap {
  text-transform: capitalize;
}

.zy-text-lower {
  text-transform: lowercase;
}

.zy-text-bold {
  font-weight: bold;
}

.zy-text-center {
  text-align: center;
}

.zy-text-left {
  text-align: left;
}

.zy-text-right {
  text-align: right;
}

.zy-text-justify {
  text-align: justify;
}

.zy-text-content {
  line-height: 1.6;
}

.zy-text-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.zy-text-ellipsis-2 {
  /* stylelint-disable-next-line value-no-vendor-prefix */
  display: -webkit-box;
  overflow: hidden;
  white-space: normal !important;
  text-overflow: ellipsis;
  word-wrap: break-word;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.zy-text-clip {
  background-clip: text;
  color: transparent !important;
}

.zy-text-break-word {
  word-wrap: break-word;
}

/* 文本 end */

/* hover 点击效果 start */
.zy-hover {
  opacity: 0.6;
}

/* hover 点击效果 end */

/* 去除原生button样式 start */
.zy-button-clear {
  background-color: transparent;
  padding: 0;
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  border-radius: inherit;
  color: inherit;
}

/* 去除原生button样式 end */

/* iPhoneX底部安全区定义 start */
.zy-safe-area-inset-bottom {
  padding-bottom: 0;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
}

/* iPhoneX底部安全区定义 end */
